#include "taskmanager.h"
#include <qvbox.h>
#include <qlabel.h>
#include <qapplication.h>
#include <qtextstream.h>
	
TabDialog::TabDialog( QWidget *parent, const char *name,const QString &_filename ): QTabDialog( parent, name )
{
	setupTab1();
	setupTab2();
	setupTab3();

	connect( this, SIGNAL( applyButtonPressed() ), qApp, SLOT( quit() ) );
}

void TabDialog::setupTab1()
{
    QVBox *tab1 = new QVBox( this );
    tab1->setMargin( 5 );
    QFile file( "/proc/cpuinfo" );
    if ( file.open( IO_ReadOnly ) )
    {
        QTextStream stream( &file );
        QString line;  
        line = stream.readLine();
        QLabel *l1 = new QLabel( line, tab1 );
        line = stream.readLine();
        QLabel *l2 = new QLabel( line, tab1 );
        line = stream.readLine();
        QLabel *l3 = new QLabel( line, tab1 );
        line = stream.readLine();
        QLabel *l4 = new QLabel( line, tab1 );
        line = stream.readLine();   
        file.close();
    }
    addTab( tab1, "CPU INFO" );
}

void TabDialog::setupTab2()
{
	QVBox *tab2 = new QVBox( this );
	tab2->setMargin( 5 );
	QStringList lines;
	QFile file( "/proc/meminfo" );

	if ( file.open( IO_ReadOnly ) )
	{
		QTextStream stream( &file );
		QString line;
		line = stream.readLine();
		QLabel *l1 = new QLabel( line, tab2 );
		line = stream.readLine();
		QLabel *l2 = new QLabel( line, tab2 );
		line = stream.readLine();
		QLabel *l3 = new QLabel( line, tab2 );
		line = stream.readLine();
	}
addTab( tab2, "MEMORY INFO" );
}


